import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import 'amfe-flexible'
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
import JavaScriptUtility from '@runtime/base/Utility/JavaScriptUtility';
import WindowLoader from '@runtime/base/Loader/WindowLoader';
import MessageDispatcherComponent from '@runtime/module/Dispatcher/MessageDispatcherComponent';
import router from "./router";
import DirectiveComponent from '@runtime/module/Directive/DirectiveComponent';
//电子白板存储
import { createPinia } from 'pinia';
// 引入elementPlus组件和样式
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//电子白板图标
import {
  Popover,
  Radio, RadioGroup,
  Slider
} from 'ant-design-vue'

WindowLoader.Default.Initialize();
JavaScriptUtility.Default.Initialize();
MessageDispatcherComponent.Default.Register();

window.addEventListener('load', OnWindowLoad);

function OnWindowLoad(): void {
  const app = createApp(App);
  //电子白板图标
  app.component('Popover', Popover)
  app.component('Radio', Radio)
  app.component('RadioGroup', RadioGroup)
  app.component('Slider', Slider)
  app.use(Antd);
  // app.use(RouterComponent.Default.Router);
  app.use(router);
  DirectiveComponent.Default.Register(app);
  app.use(createPinia())
  app.use(ElementPlus)
  app.mount('#app');
}